<html>
<head><meta charset="utf-8"><title>proxy / interceptor design help · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/proxy.20.2F.20interceptor.20design.20help.html">proxy / interceptor design help</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214169463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/proxy%20/%20interceptor%20design%20help/near/214169463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wojciech Niedźwiedź <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/proxy.20.2F.20interceptor.20design.20help.html#214169463">(Oct 22 2020 at 10:42)</a>:</h4>
<p>Client Client Client<br>
   \     |     /<br>
    \    |    /<br>
       Proxy [1]<br>
         |<br>
         |<br>
       Server<br>
[1] I want the proxy to offload some of the server's logic - some stuff<br>
    the server is currently handling is suboptimal and rewriting the server itself is <br>
    pretty much impossible. So I was thinking intercept the traffic and not bother the <br>
    server with some of the computation-heavy stuff</p>
<div class="codehilite"><pre><span></span><code>Is there something similar out there I could inspire myself with? I&#39;m struggling to come up with a design
My main concerns are:
1. how do I store the connections?
2. this example works well: https://github.com/tokio-rs/tokio/blob/master/examples/proxy.rs but then how does  message from one client can do some changes to the state of the proxy itself and send modified response to other client? I&#39;m trying to think of something idiomatic/acyclic...
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>